import os
from subprocess import call
import threading



model_path = '../train/result/model_enWeight/'

models = os.listdir(model_path)
models = list(set([i.split('.')[0] for i in models if 'model' in i]))
models = [model.split('-') for model in models]
models = [(i[0], int(i[1])) for i in models]


length, pos = len(models), 1
for name, id in models:
    print('\n\n\n--------->>> {}% Finished. <<<--------\n\n\n'.format(int(pos/length)))
    call("conda init bash;conda activate tf && python reconstruct0.py --modelname {} --ID {}".format(name, id), shell=True)
    pos += 1



